<style>
    .dataReviewKqTable {
        width: 100%;
        border:1px solid #FFF;
        border-right: none;
    }
    .dataReviewKqTable thead {
        width: 100%;
        background-color: #2669B1;
        color: #fff;
    }
    .dataReviewKqTable thead th {
        height: 30px;
        line-height: 30px;
        border-right: 1px solid #FFF;
    }
    .dataReviewKqTable tbody tr {
        border-top: 1px solid #FFF;
        background-color: #D3E5FF;
    }
    .dataReviewKqTable tbody tr td {
        height: 30px;
        line-height: 30px;
        border-right: 1px solid #FFF;
    }
    .dataReviewKqTable tbody tr td select {
        height: 30px;
    }
    .dataReviewKqTable tbody tr .data-td {
        min-width:30px;
        text-align: center; 
    }
    .dateYellow {
        background-color: #FEB726;
    }
    .dateGreen {
        background-color: #62B87A;
    }
    .hide {
        display: none;
    }
    .dataReviewKqTable .showInput {
        width: 100%;
    }
    .dataReviewKqTable .layui-form-checkbox {
        padding-left: 0px;
    }
</style>
<script type="text/html" template lay-done="layui.data.dataReviewKqTable(d);">
    <table class="dataReviewKqTable layui-form" data-id={{d.params.basic.taskid}}>
            <thead>
                <tr>
                    <th>
                        <div style="min-width:40px;text-align:center;white-space:nowrap;">
                            <input type="checkbox" lay-filter="checkAll" class="T-checkAll" lay-skin="primary">
                        </div>
                    </th>
                    <th><div style="min-width:50px;text-align:center;white-space:nowrap;">姓名</div></th>
                    <th><div style="min-width:40px;text-align:center;white-space:nowrap;">日期</div></th>
                {{#
                    if(d.params.dates) {
                        layui.each(d.params.dates, function(index,item) {
                        var tdclass = item.state === '0' ? 'dateYellow' : 'dateGreen';
                }}
                    <th class={{tdclass}}>{{item.day}}</th>
                {{#
                        })
                    }
                }}
                </tr>
            </thead>
            <tbody>
                {{#
                    var basic = d.params.basic || {};
                    if(d.params.users) {
                        layui.each(d.params.users, function(index,item) {
                }}
                <tr class='T-firstTr' data-id='{{","+item.writeid}}'>
                    <td rowspan="2" style="text-align: center;vertical-align:middle;">
                        <input type="checkbox" class="T-isChecked" lay-skin="primary">
                    </td>
                    <td rowspan="2"  class="trbasic" style="text-align: center;vertical-align:middle;white-space:nowrap;">
                        <span style="vertical-align:middle;">{{item.writeusername}}</span>
                        <input type="text" class="hide" name="dept_code" value={{basic.dept_code}} >
                        <input type="text" class="hide" name="dept_name" value={{basic.dept_name}} >
                        <input type="text" class="hide" name="dept_id" value={{basic.dept_id}} >
                        <input type="text" class="hide" name="dataid" value={{item.dataid}} >
                        <input type="text" class="hide" name="writeid" value={{item.writeid}} >
                        <input type="text" class="hide" name="writeuserid" value={{item.writeuserid}} >
                        <input type="text" class="hide" name="writeusername" value={{item.writeusername}} >
                    </td>
                    <td style="text-align: center;">上午</td>
                {{#
                    layui.each(item.users_time[0].users_time_day, function(dndex,dtem) {
                }}
                    <td><div style="min-width:50px;text-align: center;" class="T-dateInfo">
                        {{dtem.symbol}}
                        <input class="hide" type="text" name="symbol" value={{dtem.symbol}}>
                        <input type="text" class="hide" name="time" value={{dtem.date}}>
                        <input type="text" class="hide" name="time_sort" value='1' >
                    </div></td>
                {{#
                    })
                }}
                </tr>
                <tr>
                    <td style="text-align: center;">下午</td>
                    {{#
                        layui.each(item.users_time[1].users_time_day, function(index,dtem) {
                    }}
                        <td><div style="min-width:50px;text-align: center;" class="T-dateInfo">
                            {{dtem.symbol}}
                            <input class="hide" type="text" name="symbol" value={{dtem.symbol}}>
                            <input type="text" class="hide" name="time" value={{dtem.date}} >
                            <input type="text" class="hide" name="time_sort" value='2' >
                        </div></td>
                    {{#
                        })
                    }}
                </tr>
                {{#
                        })
                    }
                }}
            </tbody>
            </table>
</script>
<script>
    layui.data.dataReviewKqTable = function (d) { 
        layui.use(['admin', 'form', 'tools'], function(){
            var $ = layui.$,
                form = layui.form,
                tData = d.params.data;
            form.render();
            form.on('checkbox(checkAll)', function(data){
                var isChecked = data.elem.checked;
                $('.T-isChecked').prop('checked', isChecked);
                form.render();
            }); 
        });
    }
</script>